package com.jesper.seckill.controller;

import com.jesper.seckill.entity.vo.response.ResponseData;
import com.jesper.seckill.service.IGoodsSeckillService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sjw
 * @since 2024-01-18
 */
@RestController
@RequestMapping("/goods-seckill")
public class GoodsSeckillController{

    @Autowired
    private IGoodsSeckillService goodsSeckillService;

    @PostMapping(value = "/doSeckill")
    @ApiOperation("商品秒杀")
    public ResponseData<Integer> doSeckill(@RequestParam("goodsId") long goodsId) {
        return ResponseData.ok(goodsSeckillService.doSeckill(goodsId,null));
    }
}
